package com.fzy.modules.bill.web;

import com.fzy.core.common.ApiController;
import com.fzy.core.common.ResponseData;
import com.fzy.modules.bill.entity.WsBill;
import com.fzy.modules.bill.service.WsBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 出库Controller
 */
@RestController
@RequestMapping(value = "/api/bill/ws")
public class WsBillController extends ApiController {
    @Autowired
    WsBillService wsBillService;

    @GetMapping()
    public ResponseEntity<ResponseData> findBySoBillId(WsBill wsBill,
           @RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "rows", defaultValue = "10") int rows){
        return new ResponseEntity<>(success(wsBillService.findWsBillList(wsBill,page,rows)), HttpStatus.OK);
    }
    @GetMapping(value = "/findWsBill")
    public List<WsBill> findWsBill(){
        return wsBillService.findWsBill();
    }
}
